package pe.com.bbva.ge.domain.configuracion;

// Generated 02/04/2014 12:12:20 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import pe.com.bbva.ge.domain.base.Auditoria;

/**
 * Casetera generated by hbm2java
 */
@Entity
@Table(name = "CFG_CASETERA")
public class Casetera extends Auditoria {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(unique = true, nullable = false, precision = 19)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_CASETERA")
	@TableGenerator(name = "SEQ_CASETERA", table = Casetera.SEQ_TABLA, pkColumnName = Casetera.SEQ_TABLA_PK, initialValue = 1, valueColumnName = Casetera.SEQ_TABLA_COLUMN, pkColumnValue = "pe.com.bbva.ge.domain.configuracion.Casetera", allocationSize = 1)
	private long id;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((atm == null) ? 0 : atm.hashCode());
		result = prime * result + ((tipo == null) ? 0 : tipo.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Casetera other = (Casetera) obj;
		if (atm == null) {
			if (other.atm != null)
				return false;
		} else if (!atm.equals(other.atm))
			return false;
		if (tipo == null) {
			if (other.tipo != null)
				return false;
		} else if (!tipo.equals(other.tipo))
			return false;
		return true;
	}

	// Remplazable POR JPA

	// uni-directional many-to-one association to Atm
	@ManyToOne
	@JoinColumn(name = "ATM")
	private Atm atm;

	// bi-directional many-to-one association to TipoCasetera
	@ManyToOne
	@JoinColumn(name = "TIPO")
	private TipoCasetera tipo;

	// uni-directional many-to-one association to Valor
	@ManyToOne
	@JoinColumn(name = "ESTADO")
	private Valor estado;

	public Atm getAtm() {
		return this.atm;
	}

	public void setAtm(Atm atm) {
		this.atm = atm;
	}

	public TipoCasetera getTipo() {
		return this.tipo;
	}

	public void setTipo(TipoCasetera tipo) {
		this.tipo = tipo;
	}

	public Valor getEstado() {
		return this.estado;
	}

	public void setEstado(Valor estado) {
		this.estado = estado;
	}

}
